package com.tongna.ucrawler.apps;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

/**
 * http://npm.taobao.org/mirrors/chromedriver/2.40/
 */
public class SeleniumApp {
  public static void main(String[] args) {
    System.getProperties().setProperty("webdriver.chrome.driver", "D:\\tools\\chromedriver.exe");
    WebDriver webDriver = new ChromeDriver();
    webDriver.get("http://www.baidu.com/");
    WebElement webElement = webDriver.findElement(By.xpath("/html"));
    System.out.println(webElement.getAttribute("outerHTML"));
    webDriver.close();
  }
}
